package com.mvel;

import java.util.HashMap;
import java.util.Map;

import org.mvel2.MVEL;

public class TestMvel {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String expression = "String testStr = \"tiesheng\"; def test(){int testInt = 111;System.out.println(9999); return \"tiesheng\";} test();";

		Map<String, Object> vars = new HashMap<String, Object>();
		vars.put("foobar", new Integer(100));

		Object obj = MVEL.eval(expression, vars);
		System.out.println((String)obj);
		System.out.println("____"+vars.get("testStr")+"  "+vars.get("testInt"));
	}

}
